Providing memory bandwidth compression using adaptive compression in central processing unit (cpu)-based systems

ABSTRACT

Providing memory bandwidth compression using adaptive compression in central processing unit (CPU)-based systems is disclosed. In one aspect, a compressed memory controller (CMC) is configured to implement two compression mechanisms: a first compression mechanism for compressing small amounts of data (e.g., a single memory line), and a second compression mechanism for compressing large amounts of data (e.g., multiple associated memory lines). When performing a memory write operation using write data that includes multiple associated memory lines, the CMC compresses each of the memory lines separately using the first compression mechanism, and also compresses the memory lines together using the second compression mechanism. If the result of the second compression is smaller than the result of the first compression, the CMC stores the second compression result in the system memory. Otherwise, the first compression result is stored.

BACKGROUND I. Field of the Disclosure

The technology of the disclosure relates generally to computer memorysystems, and, in particular, to memory controllers in computer memorysystems for providing central processing units (CPUs) with a memoryaccess interface to memory.

II. Background

Microprocessors perform computational tasks for a wide variety ofapplications. A typical microprocessor application includes one or morecentral processing units (CPUs) that execute software instructions. Thesoftware instructions may instruct a CPU to fetch data from a locationin memory, perform one or more CPU operations using the fetched data,and generate a result. The result may then be stored in memory. Asnon-limiting examples, this memory can be a cache local to the CPU, ashared local cache among CPUs in a CPU block, a shared cache amongmultiple CPU blocks, or main memory of the microprocessor.

In this regard, FIG. 1 is a schematic diagram of an exemplarysystem-on-a-chip (SoC) 100 that includes a CPU-based system 102. TheCPU-based system 102 includes a plurality of CPU blocks 104(0)-104(N) inthis example, wherein ‘N’ is equal to any number of CPU blocks104(0)-104(N) desired. In the example of FIG. 1, each of the CPU blocks104(0)-104(N) contains two (2) CPUs 106(0), 106(1). The CPU blocks104(0)-104(N) further contain shared Level 2 (L2) caches 108(0)-108(N),respectively. A system cache 110 (e.g., a Level 3 (L3) cache) is alsoprovided for storing cached data that is used by any of, or sharedamong, each of the CPU blocks 104(0)-104(N). An internal system bus 112is provided to enable each of the CPU blocks 104(0)-104(N) to access thesystem cache 110 as well as other shared resources. Other sharedresources accessed by the CPU blocks 104(0)-104(N) through the internalsystem bus 112 may include a memory controller 114 for accessing a main,external memory (e.g., double-rate dynamic random access memory (DRAM)(DDR), as a non-limiting example), peripherals 116, other storage 118,an express peripheral component interconnect (PCI) (PCI-e) interface120, and/or a direct memory access (DMA) controller 122.

As CPU-based applications executing in the CPU-based system 102 in FIG.1 increase in complexity and performance, limitations on memorybandwidth may impose a constraint on the CPU-based system 102. Ifaccesses to external memory reach memory bandwidth limits, the memorycontroller 114 of the CPU-based system 102 may be forced to queue memoryaccess requests. Such queueing of memory access requests may increasethe latency of memory accesses, which in turn may decrease theperformance of the CPU-based system 102.

Memory bandwidth savings may be realized by employing memory bandwidthcompression schemes to potentially reduce the bandwidth consumed by agiven memory access. Conventional memory bandwidth compression schemesare directed to compressing an amount of data corresponding to a memoryline size of the CPU-based system 102. While increasing the memory linesize of the CPU-based system 102 may result in higher data compressionratios in some circumstances, an increased memory line size may alsocause an increase in wasted memory bandwidth. Accordingly, it isdesirable to provide a memory bandwidth compression scheme that enableshigher compression ratios while also reducing memory bandwidthconsumption.

SUMMARY OF THE DISCLOSURE

Aspects disclosed herein include providing memory bandwidth compressionusing adaptive compression in central processing unit (CPU)-basedsystems. In one aspect, a memory bandwidth compression system isprovided by a central processing unit (CPU)-based system. The memorybandwidth compression system includes a compressed memory controller(CMC) and a system cache that are configured to cooperate to provide anadaptive compression scheme. Using the adaptive compression scheme, asystem memory of the CPU-based system is organized into groups ofassociated memory lines (e.g., pairs of adjacent memory lines, in someinstances). The CMC is configured to implement two (2) compressionmechanisms: a first compression mechanism that is suitable forcompressing relatively small amounts of data (e.g., a single memoryline), and a second compression mechanism suited for compressingrelatively large amounts of data (e.g., a group of associated memorylines). When performing a memory write operation using write data sentby the system cache, the CMC may determine whether the write dataincludes a single memory line or a plurality of associated memory lines.In the latter case, the CMC performs adaptive compression by compressingseparately each of the plurality of associated memory lines using thefirst compression mechanism to generate a first compression result, andalso compressing together the plurality of memory lines using the secondcompression mechanism to generate a second compression result. If a sizeof the second compression result is smaller than a size of the firstcompression result, the CMC stores the second compression result in thesystem memory. Otherwise, the first compression result is stored in thesystem memory. The CMC in some aspects uses a master table stored in thesystem memory to track how compressed data is stored in the systemmemory (e.g., a compressed length of each memory line, a compressiontype used for each memory line, and an indication of which memorygranules within a compressed data area are occupied for the memory line,as non-limiting examples). In some aspects, the system cache isconfigured to provide a prefetch accuracy indicator that may be providedto and used by the CMC to determine whether to read compressed data fora single memory line or multiple memory lines from the system memory.

In another aspect, a memory bandwidth compression system of a CPU-basedsystem is provided. The memory bandwidth compression system includes aCMC configured to access a system memory and communicatively coupled toa system cache via a system bus. The CMC is further configured toreceive, from the system cache, a memory write request comprising amemory write address and write data. The CMC is also configured tocompress separately each memory line of a plurality of associated memorylines of the write data using a first compression mechanism to generatea first compression result. The CMC is further configured to compresstogether the plurality of associated memory lines using a secondcompression mechanism to generate a second compression result. The CMCis also configured to determine whether a size of the second compressionresult is smaller than a size of the first compression result. The CMCis additionally configured to, responsive to determining that a size ofthe second compression result is smaller than a size of the firstcompression result, write the second compression result to a compresseddata area corresponding to the memory write address in the systemmemory. The CMC is further configured to, responsive to determining thata size of the second compression result is not smaller than a size ofthe first compression result, write the first compression result to thecompressed data area corresponding to the memory write address in thesystem memory.

In another aspect, a memory bandwidth compression system of a CPU-basedsystem is provided. The memory bandwidth compression system includes ameans for receiving a memory write request comprising a memory writeaddress and write data. The memory bandwidth compression system alsoincludes a means for compressing separately each memory line of aplurality of associated memory lines of the write data using a firstcompression mechanism to generate a first compression result. The memorybandwidth compression system additionally includes a means forcompressing together the plurality of associated memory lines using asecond compression mechanism to generate a second compression result.The memory bandwidth compression system further includes a means fordetermining whether a size of the second compression result is smallerthan a size of the first compression result. The memory bandwidthcompression system also includes a means for writing the secondcompression result to a compressed data area corresponding to the memorywrite address in a system memory, responsive to determining that a sizeof the second compression result is smaller than a size of the firstcompression result. The memory bandwidth compression system additionallyincludes a means for writing the first compression result to thecompressed data area corresponding to the memory write address in thesystem memory, responsive to determining that a size of the secondcompression result is not smaller than a size of the first compressionresult.

In another aspect, a method for providing adaptive memory bandwidthcompression is provided. The method includes receiving, by a CMC from asystem cache, a memory write request comprising a memory write addressand write data. The method also includes compressing separately eachmemory line of a plurality of associated memory lines of the write datausing a first compression mechanism to generate a first compressionresult. The method additionally includes compressing together theplurality of associated memory lines using a second compressionmechanism to generate a second compression result. The method furtherincludes determining whether a size of the second compression result issmaller than a size of the first compression result. The method alsoincludes, responsive to determining that a size of the secondcompression result is smaller than a size of the first compressionresult, writing the second compression result to a compressed data areacorresponding to the memory write address in a system memory. The methodadditionally includes, responsive to determining that a size of thesecond compression result is not smaller than a size of the firstcompression result, writing the first compression result to thecompressed data area corresponding to the memory write address in thesystem memory.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a schematic diagram of an exemplary system-on-a-chip (SoC)that includes a central processing unit (CPU)-based system;

FIG. 2 is a schematic diagram of an SoC that includes an exemplaryCPU-based system having a plurality of CPUs and a compressed memorycontroller (CMC) configured to provide memory bandwidth compression;

FIG. 3 is a more detailed schematic diagram of the CMC of FIG. 2,wherein the CMC is further communicatively coupled to an optional,internal memory that may be employed to provide memory bandwidthcompression;

FIG. 4 is a diagram illustrating an exemplary memory bandwidthcompression system that may be implemented by the CMC and the systemcache of FIGS. 2 and 3 for providing adaptive memory bandwidthcompression;

FIG. 5 is a block diagram illustrating exemplary usage of availablememory granules within a compression data area for storing and updatingcompressed memory lines;

FIGS. 6A and 6B are flowcharts illustrating exemplary operations forperforming a memory write operation by the CMC and the system cache ofFIG. 2 using adaptive memory bandwidth compression;

FIGS. 7A and 7B are flowcharts illustrating exemplary operations forperforming a memory read operation by the CMC and the system cache ofFIG. 2 using adaptive memory bandwidth compression; and

FIG. 8 is a block diagram of an exemplary processor-based system thatmay include the SoC of FIG. 2 that employs the CMC and the system cacheof FIG. 2.

DETAILED DESCRIPTION

With reference now to the drawing figures, several exemplary aspects ofthe present disclosure are described. The word “exemplary” is usedherein to mean “serving as an example, instance, or illustration.” Anyaspect described herein as “exemplary” is not necessarily to beconstrued as preferred or advantageous over other aspects.

Aspects disclosed herein include providing memory bandwidth compressionusing adaptive compression in central processing unit (CPU)-basedsystems. In some aspects, a compressed memory controller (CMC) isconfigured to provide adaptive memory bandwidth compression bydecompressing memory read requests and/or compressing memory writerequests. As used herein, “adaptive compression” refers to compressingand decompressing multiple memory lines either separately using a firstcompression mechanism or together using a second compression mechanism,depending on which approach provides a greater compression ratio and/ordepending on a determined effectiveness of prefetching associated memorylines.

In this regard, FIG. 2 is a schematic diagram of a system-on-a-chip(SoC) 200 that includes a CPU-based system 202 having a plurality of CPUblocks 104(0)-104(N) similar to the CPU-based system 102 in FIG. 1. TheCPU-based system 202 in FIG. 2 includes some common components with theCPU-based system 102 in FIG. 1, which are noted by common elementnumbers between FIGS. 1 and 2. For the sake of brevity, these elementswill not be re-described. However, in the CPU-based system 202 in FIG.2, a CMC 204 is provided. The CMC 204 controls access to a system memory206. The system memory 206 may comprise one or more double data rate(DDR) dynamic random access memories (DRAMs) 208(0)-208(R) (referred tohereinafter as “DRAM 208(0)-208(R)”), as a non-limiting example. The CMC204 in this example employs memory bandwidth compression according tothe aspects disclosed herein and below. Similar to the memory controller114 of the CPU-based system 102 of FIG. 1, the CMC 204 in the CPU-basedsystem 202 in FIG. 2 is shared by the CPU blocks 104(0)-104(N) throughthe internal system bus 112. A system cache 210, having functionalitycorresponding to the system cache 110 of FIG. 1, is configured tocoordinate with the CMC 204 to provide adaptive memory bandwidthcompression, as described below in greater detail with respect to FIGS.4 and 5. It is to be understood that “adaptive memory bandwidthcompression,” as used herein, refers generally to operations carried outby the CMC 204 and the system cache 210 for both compressing data to bewritten to the system memory 206 as well as decompressing data read fromthe system memory 206.

To illustrate a more detailed schematic diagram of exemplary internalcomponents of the CMC 204 in FIG. 2, FIG. 3 is provided. In the exampleof FIG. 3, the CMC 204 is provided on a separate semiconductor die 300from semiconductor dies 302(0), 302(1) that contain the CPU blocks104(0)-104(N) in FIG. 2. Alternatively, in some aspects the CMC 204 maybe included in a common semiconductor die with the CPU blocks104(0)-104(N). Regardless of the die configurations, the CMC 204 isprovided such that the CPU blocks 104(0)-104(N) may make memory accessrequests via the internal system bus 112 to the CMC 204, and receivedata from memory through the CMC 204.

With continuing reference to FIG. 3, the CMC 204 controls operations formemory accesses to the system memory 206, which is shown in FIGS. 2 and3 as comprising DRAM 208(0)-208(R). The CMC 204 includes a plurality ofmemory interfaces (MEM I/Fs) 304(0)-304(P) (e.g., DDR DRAM interfaces)used to service memory access requests. In this regard, the CMC 204 inthis example includes a compression controller 306. The compressioncontroller 306 controls the compression of data stored to the systemmemory 206 and the decompression of data retrieved from the systemmemory 206 in response to memory access requests from the CPU blocks104(0)-104(N). The compression controller 306 can also be configured toperform bandwidth compression of information provided over the internalsystem bus 112 to the CPU blocks 104(0)-104(N).

As will be discussed in more detail below, the compression controller306 can perform any number of compression techniques and algorithms toprovide memory bandwidth compression. A local memory 308 is provided fordata structures and other information needed by the compressioncontroller 306 to perform such compression techniques and algorithms. Inthis regard, the local memory 308 is provided in the form of a staticrandom access memory (SRAM) 310. The local memory 308 is of sufficientsize to be used for data structures and other data storage that may beneeded for the compression controller 306 to perform compressiontechniques and algorithms. The local memory 308 may also be partitionedto contain a cache, such as a Level 4 (L4) cache, to provide additionalcache memory for internal use within the CMC 204. Thus, an L4 controller312 may also be provided in the CMC 204 to provide access to the L4cache. Enhanced compression techniques and algorithms may require alarger internal memory. For example, the local memory 308 may provide128 kilobytes (kB) of memory.

Further, as shown in FIG. 3, an optional, additional internal memory 314can also be provided for the CMC 204. The additional internal memory 314may be provided as DRAM, as an example. The additional internal memory314 can facilitate additional or greater amounts of storage of datastructures and other data than in the local memory 308 for the CMC 204providing memory bandwidth compression and decompression mechanisms toincrease the memory bandwidth compression of the CPU-based system 202.An internal memory controller 316 is provided in the CMC 204 to controlmemory accesses to the additional internal memory 314 for use incompression

As noted above, the CMC 204 in FIG. 3 may perform memory bandwidthcompression, including, in some aspects, zero-line compression. Thelocal memory 308 can be used to store larger data structures used forsuch compression. As discussed in greater detail below, memory bandwidthcompression may reduce memory access latency and allow more CPUs 106(0),106(1) or their respective threads to access a same number of memorycommunications channels while minimizing the impact to memory accesslatency. In some aspects, the number of memory communications channelsmay be reduced while achieving similar latency results compared to agreater number of memory communications channels if such compression wasnot performed by the CMC 204, which may result in reduced system levelpower consumption.

Each of the resources provided for memory bandwidth compression in theCMC 204 in FIG. 3, including the local memory 308 and the additionalinternal memory 314, can be used individually or in conjunction toachieve the desired balance among resources and area, power consumption,and increased performance through memory bandwidth compression. Memorybandwidth compression can be enabled or disabled, as desired. Further,the resources described above for use by the CMC 204 can be enabled ordisabled to achieve the desired tradeoffs among memory bandwidthcompression efficiency, power consumption, and performance. Exemplarymemory bandwidth compression techniques using these resources availableto the CMC 204 will now be discussed.

In this regard, FIG. 4 illustrates an exemplary memory bandwidthcompression mechanism 400 that can be implemented by the CMC 204 ofFIGS. 2 and 3 to provide memory bandwidth compression. In the memorybandwidth compression mechanism 400, the system memory 206 provides aplurality of compressed data areas 402(0)-402(D) for storing compresseddata. In this example, each of the compressed data areas 402(0)-402(D)includes a pair of adjacent memory lines, such as memory lines 404(0)and 404(1) of the compressed data area 402(0). Although not shown inFIG. 4, it is to be understood that the compressed data area 402(D) alsoincludes a pair of adjacent memory lines. It is to be further understoodthat, while FIG. 4 illustrates two memory lines 404(0), 404(1) withinthe compressed data area 402(0), each of the compressed data areas402(0)-402(D) may include more memory lines than shown herein.

Each of the memory lines 404(0), 404(1) is made up of memory granules406(0), 406(1) and 406(2), 406(3), respectively. The size of each of thememory granules 406(0)-406(3) represents the memory read/writegranularity of the system memory 206 (i.e., a smallest amount of datathat may be read from the system memory 206 in a memory read operationor written to the system memory 206 in a memory write operation). Forexample, in some exemplary memory architectures in which each of thememory lines 404(0), 404(1) is 128 bytes in size, each of the memorygranules 406(0)-406(3) may provide 64 bytes of data. Compressed datacorresponding to memory addresses associated with the memory lines404(0), 404(1) may be stored within the memory granules 406(0)-406(3) ofthe compressed data area 402(0). Some aspects may provide that each ofthe memory granules 406(0)-406(3) may comprise more or fewer bytes ofdata (e.g., 256 bytes or 64 bytes, as non-limiting examples). In someaspects, a memory read operation may read fewer bytes than the size of amemory granule 406(0)-406(3), but still consume the same amount ofmemory bandwidth as one of the memory granules 406(0)-406(3).

The memory bandwidth compression mechanism 400 further provides thesystem cache 210 configured to cache a plurality of memory lines408(0)-408(X), each of which is the same size as the memory lines404(0), 404(1) of the system memory 206. As discussed in greater detailbelow, the system cache 210 is configured to coordinate with the CMC 204to provide adaptive compression. In particular, in some aspects, thesystem cache 210 is configured to receive data for one or more memorylines 408(0)-408(X) from the CMC 204 as a single request, and may beconfigured to associate adjacent memory lines, such as the memory lines408(0), 408(1), when storing and/or evicting the memory lines 408(0),408(1). For instance, the system cache 210 may be configured to storethe associated memory lines 408(0), 408(1) within the same set, and maypreferentially evict both of the associated memory lines 408(0), 408(1)together, even if one does not contain dirty data. The system cache 210may also be configured to evict a selected one of the associated memorylines 408(0), 408(1), but write back the other associated memory line408(0), 408(1). The system cache 210 may also be configured to acceptmultiple memory lines (e.g., “prefetched” memory lines) from the CMC204.

Additionally, some aspects of the system cache 210 may be configured tomaintain data regarding prefetch accuracy, and to provide such data tothe CMC 204. For example, the system cache 210 may maintain a bit orother indicator (not shown) for each of the memory lines 408(0)-408(X)indicating whether the memory line 408(0)-408(X) was prefetched (i.e.,not specifically requested from the CMC 204, but received from the CMC204 along with a requested memory line 408(0)-408(X)). The system cache210 may also maintain a count of prefetched memory lines 408(0)-408(X)received from the CMC 204 that were subsequently accessed (i.e., read orwritten), along with a count of total prefetched memory lines408(0)-408(X) from the CMC 204. Based on this data, some aspects of thesystem cache 210 may generate a prefetch accuracy indicator 410 as aratio of the count of prefetched lines received that were subsequentlyaccessed and the count of total prefetched lines received, and mayprovide the prefetch accuracy indicator 410 to the CMC 204. In someaspects, the prefetch accuracy indicator 410 may include a binary valueindicating whether the ratio of the count of prefetched lines receivedthat were subsequently accessed and the count of total prefetched linesreceived exceeds a specified threshold. The CMC 204 may use the prefetchaccuracy indicator 410 when determining how much compressed data to readfrom the system memory 206 during a memory read operation.

The system memory 206 also includes a master table 412, which includesmultiple master table entries 414(0)-414(Z). The master table entries414(0)-414(Z) store compression indicators (CIs) 416(0)-416(D), each ofwhich provides information regarding the compression status of acorresponding compressed data area 402(0)-402(D) of the system memory206. As non-limiting examples, each of the CIs 416(0)-416(D) may encodea compressed length, a compression type, and/or an occupied memorygranules indicator for the corresponding compressed data area402(0)-402(D). In some aspects, the CIs 416(0)-416(D) have a size of six(6) to eight (8) bits, with each possible bit combination representingone potential combination of compressed length, compression type, andoccupied memory granules 406(0)-406(3). In some aspects, the CMC 204 mayfurther include a CI cache 418 providing a plurality of CI cache entries420(0)-420(C) for caching CIs 422(0)-422(V) that were previously readfrom the master table 412. Using the CI cache 418, the CMC 204 mayreduce memory access latency that may be incurred by reading the mastertable 412 in the system memory 206.

To provide adaptive memory bandwidth compression, the CMC 204 mayreceive requests for memory write operations (such as a memory writerequest 424 to store write data 426 to a memory write address 428) andmemory read operations (such as a memory read request 430 from a memoryread address 432) from the system cache 210. The CMC 204 is configuredto provide a first compression mechanism 434 and a second compressionmechanism 436 for performing compression of data. In some aspects, thefirst compression mechanism 434 may include a compression algorithm thatis suitable for compressing relatively small amounts of data (e.g., asingle 128-byte memory line 408(0)-408(X)), while the second compressionmechanism 436 may include a compression algorithm that is suitable forcompressing relatively large amounts of data (such as 256 bytes of dataprovided by a pair of associated memory lines 408(0), 408(1)).

When performing memory write operations (e.g., in response to aneviction of one or more memory lines 408(0)-408(X), the CMC 204 mayfirst determine whether the write data 426 received from the systemcache 210 includes just a single memory line (e.g., the memory line408(0)), or whether the write data 426 includes a plurality ofassociated memory lines (such as the pair of memory lines 408(0),408(1)). According to some aspects, this determination may be made basedon how many memory lines 408(0)-408(X) are written back by the systemcache 210 to the system memory 206. Some aspects may provide that thesystem cache 210 may provide a dirty bit or other indicator (not shown)for each of the memory lines 408(0)-408(X) in the write data 426. Insuch aspects, even if the write data 426 includes multiple memory lines408(0)-408(X), the CMC 204 may still determine that only a single memoryline 408(0)-408(X) should be written to the system memory 206, based onthe dirty bits for the memory lines 408(0)-408(X).

In the case where the write data 426 includes a single memory line408(0), the CMC 204 compresses the write data 426 using the firstcompression mechanism 434 to generate a first compression result 438.The first compression result 438 is then written to a compressed dataarea (such as the compressed data area 402(0)) corresponding to thememory write address 428.

However, if the write data 426 includes a plurality of associated memorylines 408(0), 408(1), the CMC 204 compresses separately each of theassociated memory lines 408(0), 408(1) using the first compressionmechanism 434 to generate the first compression result 438. The CMC 204also compresses together the associated memory lines 408(0), 408(1)using the second compression mechanism 436 to generate the secondcompression result 440. In some aspects, the CMC 204 may perform bothsets of compressions in parallel. The CMC 204 then determines whichcompression method achieved the better compression ratio by comparing asize of the second compression result 440 with a size of the firstcompression result 438. If the size of the second compression result 440is smaller, the CMC 204 writes the second compression result 440 to thecompressed data area 402(0). Otherwise, the first compression result 438is written to the compressed data area 402(0) by the CMC 204.

After writing compressed data to the system memory 206, the CMC 204 mayalso update the master table 412 and/or the CI cache 418 with an updatedCI (such as the CI 416(0) or the CI 422(0)) for the compressed data area402(0) corresponding to the memory write address 428. As non-limitingexamples, the CIs 416(0), 422(0) may include a length of the compresseddata stored in the compressed data area 402(0), a compression type(e.g., the first compression mechanism 434 or the second compressionmechanism 436) of the data stored in the compressed data area 402(0),and/or an occupied memory granules indicator indicating which of thememory granules 406(0)-406(3) are used to store compressed data withinthe compressed data area 402(0). In some aspects, the CMC 204 may writedata to one or more unoccupied memory granules 406(0)-406(3) of thecompressed data area 402(0), and/or may write to one or more memorygranules 406(0)-406(3) that were previously used to store data for thememory write address 428. In this manner, the CMC 204 may avoid the needto perform a read-modify-write (RMW) operation to update the memorygranules 406(0)-406(3). Exemplary usage of the memory granules406(0)-406(3) within the compressed data area 402(0) for storing andupdating compressed data is discussed in greater detail below withrespect to FIG. 5.

The CMC 204 in some aspects may also receive the memory read request 430from the system cache 210 (e.g., as a result of a cache miss on thesystem cache 210). The memory read request 430 may include the memoryread address 432 from which data is to be read. In some aspects, thememory read request 430 may also include the prefetch accuracy indicator410 provided by the system cache 210 to indicate how successful theprefetching of memory lines 408(0)-408(X) has been historically. The CMC204 may determine a number of memory lines 408(0)-408(X) to read fromthe system memory 206. Some aspects may provide that the CMC 204 maydetermine the number of memory lines 408(0)-408(X) to read based on theprefetch accuracy indicator 410. For example, if the prefetch accuracyindicator 410 is below a specified threshold, the CMC 204 may opt to notuse extra memory bandwidth for prefetching, and thus may read data foronly a single memory line 408(0)-408(X) from the system memory 206.

Based on the determined number of memory lines 408(0)-408(X) to read,along with a CI (such as the CI 416(0)) from a master table entry 414(0)of the master table 412, the CMC 204 may read compressed data for one ormore memory lines 408(0)-408(X) from the compressed data area 402(0) ofthe system memory 206. The CMC 204 may then decompress the compresseddata, and may return the one or more memory lines 408(0)-408(X) to thesystem cache 210. In aspects in which the CI cache 418 is in use, theCMC 204 may consult the CI cache 418 prior to accessing the master table412. If the CMC 204 determines that a CI cache entry 420(0)-420(C) ofthe CI cache 418 corresponds to the memory read address 432, the CMC 204may read a CI (such as the CI 422(0)) from the CI cache 418, thusconserving memory bandwidth by avoiding an unnecessary read to themaster table 412.

According to some aspects, the CMC 204 may also determine how manymemory lines 408(0)-408(X) to read based on memory bus utilizationand/or memory controller queue occupancy, as non-limiting examples. Forexample, the CMC 204 may reduce fetching of extra data if a memory busis congested with traffic. The CMC 204 may further take into account asize of the compressed data stored in the compressed data area 402(0),and may elect to prefetch data only if the size of the compressed datais less than or equal to a specified threshold. Once the number ofmemory lines 408(0)-408(X) is determined, the CMC 204 may inform thesystem cache 210 how many memory lines 408(0)-408(X) will be returned byproviding an indication (“IND”) 442 of whether more than one memory line408(0)-408(X) will be returned. The indication 442 in some aspects maybe provided as part of a read acknowledgement message (“READ ACK”) 444sent to the system cache 210 in response to the memory read request 430.

As noted above, the CMC 204 may be flexible in how compressed data isstored within memory granules, such as the memory granules406(0)-406(3), of the compressed data area 402(0). To illustrateexemplary usage of the memory granules 406(0)-406(3) within thecompressed data area 402(0) for storing and updating compressed data,FIG. 5 is provided. In FIG. 5, contents of the memory granules406(0)-406(3) are illustrated as a series of memory write operations andmemory read operations. It is assumed for purposes of this example thateach of the memory granules 406(0)-406(3) is 64 bytes in size. The firstmemory write operation, indicated by arrow 500, writes data from twoassociated 128-byte memory lines (e.g., the memory lines 408(0), 408(1)of FIG. 4), represented by “A” and “B,” into the memory granules406(0)-406(3) of the compressed data area 402(0). In this example, the256 bytes of A and B are compressed together by the CMC 204 into 192bytes of data. Compressed data that is exclusive to A is stored in thememory granule 406(0), while compressed data that is exclusive to B isstored in the memory granule 406(2). A plurality of common compressionpatterns for both A and B, which are generated by the compressionalgorithm and which identify and encode frequently occurring patterns inthe uncompressed data, are stored in the centrally located memorygranule 406(1), while the memory granule 406(3) is unused. Because thecompression patterns for A and B are stored in the centrally locatedmemory granule 406(1), any subsequent memory read operation for Arequires reading and decompressing only the contents of the memorygranules 406(0) and 406(1), as indicated by arrow 502. Likewise, a latermemory read operation for B requires reading only the contents of thememory granules 406(1) and 406(2). Note that in some aspects, thecompressed data that is exclusive to A and the compressed data that isexclusive to B may overflow into the memory granule 406(1) if either orboth are too large to fit within the memory granule 406(0) and/or thememory granule 406(2), respectively.

Continuing at arrow 504 in FIG. 5, new data is written for A. The newdata is uncompressible, and thus requires 128 bytes of storage space. Insome aspects, the CMC 204 is configured to recycle the memory granule406(0) to store 64 bytes of the uncompressed data (“A₀”), with theremaining 64 bytes of data (“A₁”) being stored in the previously unusedmemory granule 406(3). The memory granules 406(1) and 406(2) areundisturbed, leaving the compressed data for B intact and accessible bythe CMC 204. At arrow 506, additional new data is written for A. Whilethis additional new data is also uncompressible, the top 64 bytes ofdata for A is unchanged. Accordingly, the CMC 204 may be configured tooverwrite only the memory granule 406(0) in which modified data (“A₀′”)is stored. After each instance of new data being written to A, the CIs416(0)-416(D) that correspond to A in the master table 412 (and, in someaspects, the CIs 422(0)-422(V) that correspond to A in the CI cache 418)are updated to reflect the compression status and the storage locationsfor the compressed data for A. The compressed data for B in the memorygranules 406(1) and 406(2) remains unchanged.

Finally, at arrow 508, new data is written for B. In this example, the128 bytes of new data for B is compressed by the CMC 204 into 64 bytesof compressed data. The CMC 204 thus stores the new data for B (both thecompressed data and the corresponding compression pattern data) in thememory granule 406(1). The memory granule 406(2) is no longer needed tostore data for B, and is marked as unused by the CMC 204. The previouslystored data for A in the memory granules 406(0) and 406(3) remainsintact and accessible by the CMC 204.

To illustrate exemplary operations for performing a memory writeoperation by the CMC 204 and the system cache 210 of FIGS. 2-4 usingadaptive memory bandwidth compression, FIGS. 6A and 6B are provided.Elements of FIGS. 1-5 are referenced in describing FIGS. 6A and 6B forthe sake of clarity. In FIG. 6A, operations begin with the CMC 204receiving, from the system cache 210, the memory write request 424including the memory write address 428 and the write data 426 (block600). Accordingly, the CMC 204 may be referred to herein as “a means forreceiving a memory write request comprising a memory write address andwrite data.” In some aspects, the CMC 204 next determines whether thewrite data 426 includes a single cached memory line 408(0) or aplurality of associated cached memory lines 408(0), 408(1) (block 602).If the CMC 204 determines at decision block 602 that the write data 426includes a single cached memory line 408(0), processing resumes at block604 of FIG. 6B.

However, if the write data 426 is determined at decision block 602 toinclude a plurality of associated cached memory lines 408(0), 408(1),the CMC 204 performs adaptive memory bandwidth compression by firstcompressing each cached memory line of the plurality of associatedcached memory lines 408(0), 408(1) separately using a first compressionmechanism 434 to generate a first compression result 438 (block 606).The CMC 204 thus may be referred to herein as “a means for compressingseparately each memory line of a plurality of associated memory lines ofthe write data using a first compression mechanism to generate a firstcompression result.” As a non-limiting example, the first compressionmechanism 434 may include applying a compression algorithm optimized forrelatively smaller data sizes to each of the associated cached memorylines 408(0), 408(1). The CMC 204 also compresses the plurality ofassociated cached memory lines 408(0), 408(1) together using a secondcompression mechanism 436 to generate a second compression result 440(block 608). Accordingly, the CMC 204 may be referred to herein as “ameans for compressing together the plurality of associated memory linesusing a second compression mechanism to generate a second compressionresult.” In some aspects, the second compression mechanism 436 mayinclude applying a compression algorithm that is better suited tocompressing relatively larger data sizes to the associated cached memorylines 408(0), 408(1). Some aspects may provide that the CMC 204 isconfigured to generate the second compression result 440 in parallelwith generating the first compression result 438.

The CMC 204 then determines whether a size of the second compressionresult 440 is smaller than a size of the first compression result 438(block 610). In this regard, the CMC 204 may be referred to herein as “ameans for determining whether a size of the second compression result issmaller than a size of the first compression result.” If not (i.e., ifcompressing the associated cached memory lines 408(0), 408(1) togetherdoes not result in a smaller compressed size than compressing theassociated cached memory lines 408(0), 408(1) separately), processingresumes at block 612 of FIG. 6B. If the CMC 204 determines at decisionblock 610 that the size of the second compression result 440 is smallerthan the size of the first compression result 438, the CMC 204 writesthe second compression result 440 to the compressed data area 402(0)corresponding to the memory write address 428 in the system memory 206(block 614). The CMC 204 thus may be referred to herein as “a means forwriting the second compression result to a compressed data areacorresponding to the memory write address in a system memory, responsiveto determining that a size of the second compression result is smallerthan a size of the first compression result.” Processing then resumes atblock 616 of FIG. 6B.

Referring now to FIG. 6B, if the CMC 204 determines at decision block602 of FIG. 6A that the write data 426 includes a single cached memoryline 408(0) rather than a plurality of associated cached memory lines408(0), 408(1), the CMC 204 compresses the single cached memory line408(0) using the first compression mechanism 434 to generate the firstcompression result 438 (block 604). The CMC 204 then writes the firstcompression result 438 to the compressed data area 402(0) correspondingto the memory write address 428 in the system memory 206 (block 612). Insome aspects, operations of block 612 for writing the first compressionresult 438 to the compressed data area 402(0) may include the CMC 204writing the first compression result 438 to one or more of unoccupiedmemory granules 406(0)-406(3) of the compressed data area 402(0) or oneor more memory granules 406(0)-406(3) previously storing data for thememory write address 428 in the compressed data area 402(0), based on amaster table entry 414(0) for the compressed data area 402(0) (block618). Some aspects may also provide that the CMC 204 then stores, forthe compressed data area 402(0) corresponding to the memory writeaddress 428 in the system memory 206, a compressed length, a compressiontype, and an occupied memory granules indicator in the master tableentry 414(0) of the plurality of master table entries 414(0)-414(Z) ofthe master table 412 in the system memory 206 (block 616).

FIGS. 7A and 7B illustrate exemplary operations for performing a memoryread operation by the CMC 204 and the system cache 210 of FIGS. 2-4using adaptive memory bandwidth compression. For the sake of clarity,elements of FIGS. 2-4 are referenced in describing FIGS. 7A and 7B.Operations in FIG. 7A begin with the CMC 204 receiving, from the systemcache 210, a memory read request 430 comprising a memory read address432 (block 700). The CMC 204 determines a number of memory lines408(0)-408(X) to read from the system memory 206 in response to thememory read request 430 (block 702). As non-limiting examples, the CMC204 may make the determination regarding how many memory lines408(0)-408(X) to read from the system memory 206 based on memory busutilization and/or on a size of compressed data stored in the compresseddata area 402(0) corresponding to the memory read address 432 in thesystem memory 206. Some aspects may provide that the CMC 204 maydetermine how many memory lines 408(0)-408(X) to read from the systemmemory 206 based on a prefetch accuracy indicator 410 provided by thesystem cache 210 as part of the memory read request 430.

In aspects in which a CI cache 418 is in use, the CMC 204 may nextdetermine whether a CI cache entry 420(0) of the plurality of CI cacheentries 420(0)-420(C) of the CI cache 418 corresponds to the memory readaddress 432 (block 704). If so, the CMC 204 reads compressed data forthe one or more memory lines 408(0)-408(X) from the compressed data area402(0) corresponding to the memory read address 432 in the system memory206, based on the determined number of memory lines 408(0)-408(X) toread and the CI cache entry 420(0) (block 706). Processing then resumesat block 708 of FIG. 7B. If a CI cache 418 is not in use, or if the CMC204 determines at decision block 704 that none of the plurality of CIcache entries 420(0)-420(C) of the CI cache 418 corresponds to thememory read address 432, the CMC 204 reads compressed data for the oneor more memory lines 408(0)-408(X) from the compressed data area 402(0)corresponding to the memory read address 432 in the system memory 206,based on the determined number of memory lines 408(0)-408(X) to read andthe master table entry 414(0) corresponding to the compressed data area402(0) in the master table 412 (block 710). Processing resumes at block708 of FIG. 7B.

Referring now to FIG. 7B, the CMC 204 next decompresses the compresseddata for the one or more memory lines 408(0)-408(X) (block 708). In someaspects, the CMC 204 may provide to the system cache 210 an indication442 of whether more than one memory line 408(0)-408(X) will be returned(block 712). This indication 442 may be provided in some aspects as partof a read acknowledgement message 444 to the system cache 210, as anon-limiting example (block 714). In some aspects, operations of block708 for decompressing the compressed data for the one or more memorylines 408(0)-408(X) may vary depending on how many memory lines408(0)-408(X) were read, how many memory granules 406(0)-406(3) storecompressed data, and/or on whether the first compression mechanism 434or the second compression mechanism 436 was used to compress thecompressed data. As non-limiting examples, the one or more memory lines408(0)-408(X) may have been compressed together using the secondcompression mechanism 436 into two (2) or four (4) of the memorygranules 406(0)-406(3), may have been compressed together using thefirst compression mechanism 434 into two (2) of the memory granules406(0)-406(3), or may have been compressed separately using either thefirst compression mechanism 434 or the second compression mechanism 436.The CMC 204 thus may use the master table entry 414(0) (or the CI cacheentry 420(0)) to determine the appropriate decompression mechanism toemploy, and to determine how much compressed data to decompress. Becausethe compressed data may be located at any position within the compresseddata area 402(0), the CMC 204 may also use the master table entry 414(0)(or the CI cache entry 420(0)) to determine the memory granules406(0)-406(3) from which to read compressed data. The CMC 204 thenreturns the one or more memory lines 408(0)-408(X) to the system cache210 (block 716). According to some aspects, the system cache 210 isconfigured to receive a plurality of memory lines 408(0)-408(X)responsive to the indication 442 (block 718).

Providing memory bandwidth compression using adaptive compression inCPU-based systems according to aspects disclosed herein may be providedin or integrated into any processor-based device. Examples, withoutlimitation, include a set top box, an entertainment unit, a navigationdevice, a communications device, a fixed location data unit, a mobilelocation data unit, a global positioning system (GPS) device, a mobilephone, a cellular phone, a smart phone, a session initiation protocol(SIP) phone, a tablet, a phablet, a server, a computer, a portablecomputer, a mobile computing device, a wearable computing device (e.g.,a smart watch, a health or fitness tracker, eyewear, etc.), a desktopcomputer, a personal digital assistant (PDA), a monitor, a computermonitor, a television, a tuner, a radio, a satellite radio, a musicplayer, a digital music player, a portable music player, a digital videoplayer, a video player, a digital video disc (DVD) player, a portabledigital video player, an automobile, a vehicle component, avionicssystems, a drone, and a multicopter.

In this regard, FIG. 8 illustrates an example of a processor-basedsystem 800 that can employ the SoC 200 with the CMC 204 of FIG. 2. Inthis example, the processor-based system 800 includes one or more CPUs802, each including one or more processors 804. The CPU(s) 802 may havecache memory 806 coupled to the processor(s) 804 for rapid access totemporarily stored data. The CPU(s) 802 is coupled to a system bus 808and can intercouple devices included in the processor-based system 800.As is well known, the CPU(s) 802 communicates with these other devicesby exchanging address, control, and data information over the system bus808. For example, the CPU(s) 802 can communicate bus transactionrequests to the CMC 204 as an example of a slave device. Although notillustrated in FIG. 8, multiple system buses 808 could be provided.

Other devices can be connected to the system bus 808. As illustrated inFIG. 8, these devices can include a memory system 810, one or more inputdevices 812, one or more output devices 814, one or more networkinterface devices 816, and one or more display controllers 818, asexamples. The input device(s) 812 can include any type of input device,including but not limited to input keys, switches, voice processors,etc. The output device(s) 814 can include any type of output device,including but not limited to audio, video, other visual indicators, etc.The network interface device(s) 816 can be any devices configured toallow exchange of data to and from a network 820. The network 820 can beany type of network, including but not limited to a wired or wirelessnetwork, a private or public network, a local area network (LAN), a widelocal area network, wireless local area network, BLUETOOTH (BT), and theInternet. The network interface device(s) 816 can be configured tosupport any type of communications protocol desired. The memory system810 can include one or more memory units 822(0)-822(N).

The CPU(s) 802 may also be configured to access the displaycontroller(s) 818 over the system bus 808 to control information sent toone or more displays 824. The display controller(s) 818 sendsinformation to the display(s) 824 to be displayed via one or more videoprocessors 826, which process the information to be displayed into aformat suitable for the display(s) 824. The display(s) 824 can includeany type of display, including but not limited to a cathode ray tube(CRT), a liquid crystal display (LCD), a light emitting diode (LED)display, a plasma display, etc.

The devices described herein may be employed in any circuit, hardwarecomponent, integrated circuit (IC), or IC chip, as examples. Memorydisclosed herein may be any type and size of memory and may beconfigured to store any type of information desired. To clearlyillustrate this interchangeability, various illustrative components,blocks, modules, circuits, and steps have been described above generallyin terms of their functionality. How such functionality is implementeddepends upon the particular application, design choices, and/or designconstraints imposed on the overall system. Skilled artisans mayimplement the described functionality in varying ways for eachparticular application, but such implementation decisions should not beinterpreted as causing a departure from the scope of the presentdisclosure.

The various illustrative logical blocks, modules, controllers, andcircuits described in connection with the aspects disclosed herein maybe implemented or performed with a processor, a Digital Signal Processor(DSP), an Application Specific Integrated Circuit (ASIC), a FieldProgrammable Gate Array (FPGA) or other programmable logic device,discrete gate or transistor logic, discrete hardware components, or anycombination thereof designed to perform the functions described herein.A processor may be a microprocessor, but in the alternative, theprocessor may be any conventional processor, controller,microcontroller, or state machine. A processor may also be implementedas a combination of computing devices, e.g., a combination of a DSP anda microprocessor, a plurality of microprocessors, one or moremicroprocessors in conjunction with a DSP core, or any other suchconfiguration.

It is also noted that the operational steps described in any of theexemplary aspects herein are described to provide examples anddiscussion. The operations described may be performed in numerousdifferent sequences other than the illustrated sequences. Furthermore,operations described in a single operational step may actually beperformed in a number of different steps. Additionally, one or moreoperational steps discussed in the exemplary aspects may be combined. Itis to be understood that the operational steps illustrated in the flowchart diagrams may be subject to numerous different modifications aswill be readily apparent to one of skill in the art. Those of skill inthe art will also understand that information and signals may berepresented using any of a variety of different technologies andtechniques. For example, data, instructions, commands, information,signals, bits, symbols, and chips that may be referenced throughout theabove description may be represented by voltages, currents,electromagnetic waves, magnetic fields or particles, optical fields orparticles, or any combination thereof.

The previous description of the disclosure is provided to enable anyperson skilled in the art to make or use the disclosure. Variousmodifications to the disclosure will be readily apparent to thoseskilled in the art, and the generic principles defined herein may beapplied to other variations without departing from the spirit or scopeof the disclosure. Thus, the disclosure is not intended to be limited tothe examples and designs described herein, but is to be accorded thewidest scope consistent with the principles and novel features disclosedherein.

What is claimed is:
 1. A memory bandwidth compression system of acentral processing unit (CPU)-based system, comprising a compressedmemory controller (CMC) configured to access a system memory andcommunicatively coupled to a system cache via a system bus; the CMCfurther configured to: receive, from the system cache, a memory writerequest comprising a memory write address and write data; compressseparately each memory line of a plurality of associated memory lines ofthe write data using a first compression mechanism to generate a firstcompression result; compress together the plurality of associated memorylines using a second compression mechanism to generate a secondcompression result; determine whether a size of the second compressionresult is smaller than a size of the first compression result;responsive to determining that a size of the second compression resultis smaller than a size of the first compression result, write the secondcompression result to a compressed data area corresponding to the memorywrite address in the system memory; and responsive to determining that asize of the second compression result is not smaller than a size of thefirst compression result, write the first compression result to thecompressed data area corresponding to the memory write address in thesystem memory.
 2. The memory bandwidth compression system of claim 1,further configured to: after receiving the memory write requestcomprising the memory write address and the write data: determinewhether the write data comprises a single memory line or the pluralityof associated memory lines; and responsive to determining that the writedata comprises a single memory line: compress the single memory lineusing the first compression mechanism to generate the first compressionresult; and write the first compression result to the compressed dataarea corresponding to the memory write address in the system memory; thememory bandwidth compression system configured to compress separatelyeach memory line of the plurality of associated memory lines of thewrite data using the first compression mechanism to generate the firstcompression result and compress together the plurality of associatedmemory lines using the second compression mechanism to generate thesecond compression result responsive to determining that the write datacomprises the plurality of associated memory lines.
 3. The memorybandwidth compression system of claim 2, wherein: the system cache isconfigured to provide the write data comprising: the plurality ofassociated memory lines; and a plurality of dirty bits each indicatingwhether data stored in a corresponding memory line of the plurality ofassociated memory lines has been modified; and the CMC is configured todetermine whether the write data comprises a single memory line or aplurality of associated memory lines based on the plurality of dirtybits.
 4. The memory bandwidth compression system of claim 2, wherein theCMC is further configured to store, for the compressed data areacorresponding to the memory write address in the system memory, acompressed length, a compression type, and an occupied memory granulesindicator in a master table entry of a plurality of master table entriesof a master table in the system memory.
 5. The memory bandwidthcompression system of claim 4, wherein the CMC is configured to writethe first compression result to the compressed data area correspondingto the memory write address in the system memory by writing the firstcompression result to one or more of unoccupied memory granules of thecompressed data area or one or more memory granules previously storingdata for the memory write address in the compressed data area, based onthe master table entry for the compressed data area.
 6. The memorybandwidth compression system of claim 4, wherein the CMC is furtherconfigured to write a plurality of common compression patterns for theplurality of associated memory lines into a centrally located memorygranule in the compressed data area.
 7. The memory bandwidth compressionsystem of claim 4, wherein the CMC is further configured to: receive,from the system cache, a memory read request comprising a memory readaddress; determine a number of memory lines to read from the systemmemory in response to the memory read request; read compressed data forone or more memory lines from a compressed data area corresponding tothe memory read address in the system memory, based on the determinednumber of memory lines to read and a master table entry corresponding tothe compressed data area in the master table; decompress the compresseddata into the one or more memory lines; and return the one or morememory lines to the system cache.
 8. The memory bandwidth compressionsystem of claim 7, wherein the CMC is configured to determine the numberof memory lines to read based on memory bus utilization.
 9. The memorybandwidth compression system of claim 7, wherein the CMC is configuredto determine the number of memory lines to read based on a size of thecompressed data stored in the compressed data area corresponding to thememory read address in the system memory.
 10. The memory bandwidthcompression system of claim 7, wherein: the system cache is configuredto provide the memory read request further comprising a prefetchaccuracy indicator; and the CMC is configured to determine the number ofmemory lines to read based on the prefetch accuracy indicator.
 11. Thememory bandwidth compression system of claim 10, wherein the systemcache is configured to: maintain a count of prefetched lines receivedfrom the CMC that were subsequently accessed; maintain a count of totalprefetched lines received from the CMC; and generate the prefetchaccuracy indicator based on a ratio of the count of prefetched linesreceived that were subsequently accessed and the count of totalprefetched lines received.
 12. The memory bandwidth compression systemof claim 7, wherein: the CMC further comprises a compression indicator(CI) cache comprising a plurality of CI cache entries corresponding toone or more previously accessed master table entries of the plurality ofmaster table entries of the master table; the CMC is further configuredto, prior to reading the compressed data for the one or more memorylines from the compressed data area: determine whether a CI cache entryof the plurality of CI cache entries corresponds to the memory readaddress; and responsive to determining that a CI cache entry of theplurality of CI cache entries corresponds to the memory read address,read the compressed data for the one or more memory lines from thecompressed data area corresponding to the memory read address in thesystem memory, based on the CI cache entry; and the CMC is configured toread the compressed data for the one or more memory lines from thecompressed data area corresponding to the memory read address in thesystem memory responsive to determining that no CI cache entry of theplurality of CI cache entries corresponds to the memory read address.13. The memory bandwidth compression system of claim 7, wherein the CMCis further configured to, prior to returning the one or more memorylines to the system cache, provide to the system cache an indication ofwhether more than one memory line will be returned.
 14. The memorybandwidth compression system of claim 13, wherein the CMC is configuredto provide to the system cache the indication of whether more than onememory line will be returned as part of a read acknowledgement messageto the system cache.
 15. The memory bandwidth compression system ofclaim 13, wherein the system cache is further configured to receive aplurality of memory lines responsive to the indication provided by theCMC.
 16. The memory bandwidth compression system of claim 1 integratedinto an integrated circuit (IC).
 17. The memory bandwidth compressionsystem of claim 1 integrated into a device selected from the groupconsisting of: a set top box; an entertainment unit; a navigationdevice; a communications device; a fixed location data unit; a mobilelocation data unit; a global positioning system (GPS) device; a mobilephone; a cellular phone; a smart phone; a session initiation protocol(SIP) phone; a tablet; a phablet; a server; a computer; a portablecomputer; a mobile computing device; a wearable computing device (e.g.,a smart watch, a health or fitness tracker, eyewear, etc.); a desktopcomputer; a personal digital assistant (PDA); a monitor; a computermonitor; a television; a tuner; a radio; a satellite radio; a musicplayer; a digital music player; a portable music player; a digital videoplayer; a video player; a digital video disc (DVD) player; a portabledigital video player; an automobile; a vehicle component; avionicssystems; a drone; and a multicopter.
 18. A memory bandwidth compressionsystem of a central processing unit (CPU)-based system, comprising: ameans for receiving a memory write request comprising a memory writeaddress and write data; a means for compressing separately each memoryline of a plurality of associated memory lines of the write data using afirst compression mechanism to generate a first compression result; ameans for compressing together the plurality of associated memory linesusing a second compression mechanism to generate a second compressionresult; a means for determining whether a size of the second compressionresult is smaller than a size of the first compression result; a meansfor writing the second compression result to a compressed data areacorresponding to the memory write address in a system memory, responsiveto determining that a size of the second compression result is smallerthan a size of the first compression result; and a means for writing thefirst compression result to the compressed data area corresponding tothe memory write address in the system memory, responsive to determiningthat a size of the second compression result is not smaller than a sizeof the first compression result.
 19. A method for providing adaptivememory bandwidth compression, comprising: receiving, by a compressedmemory controller (CMC) from a system cache, a memory write requestcomprising a memory write address and write data; compressing separatelyeach memory line of a plurality of associated memory lines of the writedata using a first compression mechanism to generate a first compressionresult; compressing together the plurality of associated memory linesusing a second compression mechanism to generate a second compressionresult; determining whether a size of the second compression result issmaller than a size of the first compression result; responsive todetermining that a size of the second compression result is smaller thana size of the first compression result, writing the second compressionresult to a compressed data area corresponding to the memory writeaddress in a system memory; and responsive to determining that a size ofthe second compression result is not smaller than a size of the firstcompression result, writing the first compression result to thecompressed data area corresponding to the memory write address in thesystem memory.
 20. The method of claim 19, further comprising, afterreceiving the memory write request comprising the memory write addressand the write data: determining whether the write data comprises asingle memory line or the plurality of associated memory lines; andresponsive to determining that the write data comprises a single memoryline: compressing the single memory line using the first compressionmechanism to generate the first compression result; and writing thefirst compression result to the compressed data area corresponding tothe memory write address in the system memory; wherein compressingseparately each memory line of the plurality of associated memory linesusing the first compression mechanism to generate the first compressionresult and compressing together the plurality of associated memory linesusing the second compression mechanism to generate the secondcompression result is responsive to determining that the write datacomprises the plurality of associated memory lines.
 21. The method ofclaim 20, wherein determining whether the write data comprises a singlememory line or a plurality of associated memory lines is based on aplurality of dirty bits provided with the write data, each dirty bitindicating whether data stored in a corresponding memory line of theplurality of associated memory lines has been modified.
 22. The methodof claim 20, further comprising storing, for the compressed data areacorresponding to the memory write address in the system memory, acompressed length, a compression type, and an occupied memory granulesindicator in a master table entry of a plurality of master table entriesof a master table in the system memory.
 23. The method of claim 22,wherein writing the first compression result to the compressed data areacorresponding to the memory write address in the system memory compriseswriting the first compression result to one or more of unoccupied memorygranules of the compressed data area or one or more memory granulespreviously storing data for the memory write address in the compresseddata area, based on the master table entry for the compressed data area.24. The method of claim 22, further comprising writing a plurality ofcommon compression patterns for the plurality of associated memory linesinto a centrally located memory granule in the compressed data area. 25.The method of claim 22, further comprising: receiving, from the systemcache, a memory read request comprising a memory read address;determining a number of memory lines to read from the system memory inresponse to the memory read request; reading compressed data for one ormore memory lines from a compressed data area corresponding to thememory read address in the system memory, based on the determined numberof memory lines to read and a master table entry corresponding to thecompressed data area in the master table; decompressing the compresseddata into the one or more memory lines; and returning the one or morememory lines to the system cache.
 26. The method of claim 25, whereindetermining the number of memory lines to read is based on memory busutilization.
 27. The method of claim 25, wherein determining the numberof memory lines to read is based on a size of the compressed data storedin the compressed data area corresponding to the memory read address inthe system memory.
 28. The method of claim 25, wherein determining thenumber of memory lines to read is based on a prefetch accuracy indicatorprovided by the memory read request.
 29. The method of claim 28, whereinthe prefetch accuracy indicator is generated by the system cache basedon a ratio of a count of prefetched lines received that weresubsequently accessed and a count of total prefetched lines received.30. The method of claim 25, further comprising, prior to reading thecompressed data for the one or more memory lines from the compresseddata area: determining whether a compression indicator (CI) cache entryof a plurality of CI cache entries of a CI cache corresponds to thememory read address; and responsive to determining that a CI cache entryof the plurality of CI cache entries corresponds to the memory readaddress, reading the compressed data for the one or more memory linesfrom the compressed data area corresponding to the memory read addressin the system memory, based on the determined number of memory lines toread and the CI cache entry; wherein reading the compressed data for theone or more memory lines from the compressed data area corresponding tothe memory read address in the system memory based on the determinednumber of memory lines to read and the master table entry correspondingto the compressed data area in the master table is responsive todetermining that no CI cache entry of the plurality of CI cache entriescorresponds to the memory read address.
 31. The method of claim 25,further comprising, prior to returning the one or more memory lines tothe system cache, providing to the system cache an indication of whethermore than one memory line will be returned.
 32. The method of claim 31,wherein providing to the system cache the indication of whether morethan one memory line will be returned comprises returning the indicationas part of a read acknowledgement message to the system cache.
 33. Themethod of claim 31, further comprising receiving, by the system cache, aplurality of memory lines responsive to the indication.